<?php

require_once 'common/conn.php';

$result = array();
$db = new DBC();
$usercode = $_GET['usercode'];
if (!isset($usercode)) {
    $usercode = $_POST['usercode'];
}

if (isset($_GET['face'])) {
    $face = $_GET['face'];
    if ($face == "startTimes") {
        
    }
}
if (isset($usercode) && isset($_GET['face'])) {
    $face = trim($_GET['face']);
    $sql = "UPDATE t_device SET " . $face . " = " . $face . " + 1 WHERE usercode = '" . $usercode . "'";
    if ($db->execute($sql)) {
        $result['errorNo'] = 0;
    } else {
        $result['errorNo'] = 1;
        $result['errorMsg'] = "更新次数失败";
    }
}
echo json_encode($result);
?>